package com.ssy.lingxi.report.api.enums;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 *  会员入库-操作类型枚举
 * @author ds
 * @date 2021/5/8
 * @version 2.0.0
 */
public enum MemberImportOperateTypeEnum {

    /**
     * 待审核入库资料
     */
    TO_BE_VALIFY_INFO(1, "待审核入库资料", "/memberCenter/memberAbility/manage/memberPrVerifyComingData"),

    /**
     * 待审核入库资质
     */
    TO_BE_VALIFY_QUALIFICATION(2, "待审核入库资质", "/memberCenter/memberAbility/manage/memberPrVerifyComingQualifications"),
    /**
     * 待入库考察
     */
    TO_BE_IMPORT_EXPLORE(3, "待入库考察", "/memberCenter/memberAbility/manage/memberPrComingInvestigate"),
    /**
     * 待入库分类
     */
    TO_BE_IMPORT_CLASSIFY(4, "待入库分类", "/memberCenter/memberAbility/manage/memberPrComingClassify"),
    /**
     * 待审核入库(一级)
     */
    TO_BE_VALIFY_STEP1(5, "待审核入库(一级)", "/memberCenter/memberAbility/manage/memberPrVerifyComing1"),
    /**
     * 待审核入库(二级)
     */
    TO_BE_VALIFY_STEP2(6, "待审核入库(二级)", "/memberCenter/memberAbility/manage/memberPrVerifyComing2"),
    /**
     * 待确认入库
     */
    TO_BE_CONFIRM(7, "待确认入库", "/memberCenter/memberAbility/manage/memberPrVerifyComingConfirm");

    /**
     * 编码
     */
    private final Integer code;
    /**
     * 名称
     */
    private final String name;
    /**
     * 链接
     */
    private final String link;


    MemberImportOperateTypeEnum(Integer code, String name, String link) {
        this.code = code;
        this.name = name;
        this.link = link;
    }

    public static MemberImportOperateTypeEnum getEnum(Integer code) {
        return Arrays.stream(MemberImportOperateTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }


    public Integer getCode() {
        return code;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public String getLink() {
        return link;
    }

}
